package com.czk.controller;

import com.czk.pojo.User;
import com.czk.service.userservice.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/9/29 15:52
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/select/{id}")
    public User getUserById(@PathVariable("id") int id) {
        return userService.selectById(id);
    }
}
